/*class UserNameException extends Exception {
    public UserNameException(String message) {
        super(message);
    }
}
class PasswordException extends Exception {
    public PasswordException(String message) {
        super(message);
    }
}

public class LogIn {
    private String userName = "admin";
    private String password = "123456";
    public static void loginInfo(String userName, String password) {
        if (!userName.equals(userName)) {
        } if
        (!password.equals(password)) {
        }
        System.out.println("登陆成功");
    }
    public static void main(String[] args) {
        loginInfo("admin", "123456");
    }
    private String userName = "admin";
    private String password = "123456";
    public static void loginInfo(String userName, String password)
            throws UserNameException, PasswordException {
        if (!userName.equals(userName)) {
            throw new UserNameException("用户名错误！");
        }
        if
        (!password.equals(password)) {
            throw new PasswordException("用户名错误！");
        }
        System.out.println("登陆成功");
    }

    public static void main(String[] args) {
        try {
            loginInfo("admin", "123456");
        } catch (UserNameException e) {
            e.printStackTrace();
        } catch (PasswordException e) {
            e.printStackTrace();
        }
    }
}*/


public class LogIn {
    private String userName = "abcdef";
    private String password = "1234567890";
    public void loginInfo(String userName, String password) {
        if (!this.userName.equals(userName)) {
            System.out.println("用户名错误！");
            return;
        }
        if (!this.password.equals(password)) {
            System.out.println("密码错误！");
            return ;
        }
        System.out.println("登陆成功");
    }
    public static void main(String[] args) {
        LogIn logIn = new LogIn();
        logIn.loginInfo("abcdef", "1234567890");
    }
}
